# -*- coding: utf-8 -*-
'''
@author: olivia.dou
Created on: 2019/4/4 21:57
desc: 加载二级行业-四级行业对应关系
'''

import os
import pandas as pd

abspath = os.path.split(os.path.realpath(__file__))[0]
ind_mapping = pd.read_excel(abspath+os.sep+"行业二级四级分类.xls")
#print(ind_mapping)

def get_level2_industries():
    return list(ind_mapping['二级名称'].unique())

def get_level2_industry(level4_ind_name):
    result = ind_mapping[ind_mapping['四级名称'] == level4_ind_name]['二级名称']
    if len(result)>0:
        return result.iloc[0]
    else:
        return ""

